import 'dart:async';

import 'package:flutter/services.dart';
import 'package:package_info/package_info.dart';

class TUpgradePlugin {
  static const MethodChannel _channel = const MethodChannel('t_upgrade_plugin');

  static Future<String> get platformVersion async {
    final String version = await _channel.invokeMethod('getPlatformVersion');
    return version;
  }

  static Future installApk(String filePatch) async {
    await _channel.invokeMethod('installApk', {"filePatch": filePatch});
  }

  static Future<String> getCurrentVersion() async{
    PackageInfo packageInfo = await PackageInfo.fromPlatform();
    return  packageInfo.version;
  }
}
